package com.huaxinkai.mobile.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.huaxinkai.entity.BaseEntity;
/**
 * js ticket实体类
 * @author liuzh
 * @date 2017年1月5日下午11:09:06
 */
@Entity
@Table(name="js_api_ticket")
public class JsAPITicket extends BaseEntity {
	
	private int id;
	
	private String ticket;
	
	private int expiresIn = 7200 ;	//有效时长
	
	private Date updateDate = new Date();
	
	private Date loseEfficacyDate = new Date(new Date().getTime() + 7200 * 1000);

	@Id
	@Column(name="id",nullable=false,unique=true)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	@Column(name="ticket",nullable=false)
	public String getTicket() {
		return ticket;
	}

	public void setTicket(String ticket) {
		this.ticket = ticket;
	}
	
	@Column(name="expiresIn",nullable=false)
	public int getExpiresIn() {
		return expiresIn;
	}

	public void setExpiresIn(int expiresIn) {
		this.expiresIn = expiresIn;
	}

	@Column(name="updateDate",nullable=false)
	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	
	@Column(name="loseEfficacyDate",nullable=false)
	public Date getLoseEfficacyDate() {
		return loseEfficacyDate;
	}

	public void setLoseEfficacyDate(Date loseEfficacyDate) {
		this.loseEfficacyDate = loseEfficacyDate;
	}

	public JsAPITicket() {
		
	}

	@Override
	public String toString() {
		return "JsAPITicket [id=" + id + ", ticket=" + ticket + ", expiresIn=" + expiresIn + ", updateDate="
				+ updateDate + ", loseEfficacyDate=" + loseEfficacyDate + "]";
	}
	
	
}
